package com.zx.idc.backend.gui.slog;


import com.zx.idc.backend.gui.common.BaseApi;
import com.zx.idc.backend.gui.common.Result;
import com.zx.idc.ds.common.mongopage.Page;
import com.zx.idc.ds.slog.service.ISlogHotUrlService;
import com.zx.idc.ds.slog.vo.SlogHotUrlVo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 活跃URL地址信息表 前端控制器
 */
@RestController
@RequestMapping("/api/slogHotUrl")
public class SlogHotUrlController extends BaseApi {

    @Autowired
    private ISlogHotUrlService iSlogHotUrlService;

    @GetMapping("/query-page")
    @RequiresPermissions("regulatory-log:slog-hot-url")
    public Result<Page<SlogHotUrlVo>> page(Page<SlogHotUrlVo> page, SlogHotUrlVo slogHotUrlVo) {
        return success(iSlogHotUrlService.queryPage(page, slogHotUrlVo));
    }

    @PostMapping("/delete/batch")
    @RequiresPermissions("regulatory-log:slog-hot-url:edit")
    public Result<Boolean> delete(@RequestBody List<String> idList) {
        if (idList.isEmpty()) {
            return success(true);
        }
        return success(iSlogHotUrlService.deleteBatch(idList));
    }

}

